package org.grottarossa.tms.PSAPV.ui.home;

import java.util.ResourceBundle;

import org.grottarossa.template.drivers.DriverException;
import org.grottarossa.ui.core.ApplicationSession;
import org.grottarossa.ui.core.i18n.DM;

/***
 * Si occupa della creazione della Home Page per la console PSA
 * @author 
 *
 */
public class HomePageFactory
{
	private final ApplicationSession m_appSession;
	private ResourceBundle m_localizer = DM.instance().getBundle(getClass().getPackage().getName() + ".Resources");;

	public HomePageFactory(ApplicationSession appSession)
	{
		this.m_appSession = appSession;
	}

	/***
	 * Crea la Home Page
	 * @return
	 * @throws DriverException
	 */
	public HomePage createHomePage() throws DriverException
	{
		HomePage view = new HomePage(m_appSession, m_localizer);
		HomePagePresenter presenter = new HomePagePresenter(view, m_appSession, m_localizer);
		presenter.initialize();

		return view;
	}
}
